import request from '@/utils/request'

// 查询单元列表
export function listUnits(query) {
  return request({
    url: '/business/unit/list',
    method: 'get',
    params: query
  })
}

// 查询单元详细
export function getUnits(unitId) {
  return request({
    url: '/business/unit/' + unitId,
    method: 'get'
  })
}

// 新增单元
export function addUnits(data) {
  return request({
    url: '/business/unit',
    method: 'post',
    data: data
  })
}

// 修改单元
export function updateUnits(data) {
  return request({
    url: '/business/unit',
    method: 'put',
    data: data
  })
}

// 删除单元
export function delUnits(unitId) {
  return request({
    url: '/business/unit/' + unitId,
    method: 'delete'
  })
}

// 导出单元
export function exportUnits(query) {
  return request({
    url: '/business/unit/export',
    method: 'get',
    params: query
  })
}
